home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
05
/
6
/
DISK0564.ZIP
/
SOURCE.ARC
/
B.ARC
/
CPYCNT.C
< prev
next >
Wrap
Text File
|
1986-03-17
|
503b
|
14 lines
char *cpycnt(source,dest,n)
register char *source,*dest; int *n;
/* copies from source to dest until null copied, or at most n chars. copied.
if null not found in source, appends a null to dest at end. sets n to
the number of chars short of the limit in dest (0 if dest full).
also returns pointer to null in dest. */
/* n.b. this is different from Manx's strncpy function. */
{
while ((*source) && (*n)--)
*dest++ = *source++;
*dest = '\000';
return(dest);
}